<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue事件处理</title>
    <script src="../commonjs/vue.js"></script>
</head>
<body>
    <div id="app">
        <h2>欢迎来{{school.name}}上学</h2>
        <button v-on:click="showInfo1">查看信息1</button>
        <button @click="showInfo2($event,66)">查看信息2</button>
    </div>
    <script type="text/javascript">
        Vue.config.productionTip = false;//关闭开发提示
        new Vue({
            el:'#app',
            data(){
                return{
                    school:{name:'武威职业学院'}
                }
            },
            methods:{
                showInfo1(){
                    alert("同学你好！")
                },
                showInfo2(event,number){
                    console.log(number,event)
                    alert(number)
                }
            }
        })
    </script>
</body>
</html>